package com.weishaoying.example.base.profile;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/**
 * @author WeiShaoying
 * @date 2018/4/4
 */
public class ProfileTest {

    public static void main(String[] args) {
        AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext();

        context.getEnvironment().setActiveProfiles("prod2");
        context.register(JavaConfig.class);
        context.refresh();
        Dog dog = context.getBean(Dog.class);
        System.out.println(dog.getName());
        context.close();
    }
}
